<template>
  <c-select
    v-bind="$attrs"
    v-on="$listeners"
    filterable
    :value="value"
    :options="options"
    @change="hangleChange"
  ></c-select>
</template>

<script>
import { getEnum } from '@/cadmin/components/select/enum'
export default {
  components: {},
  props: {
    value: {
      type: String,
      default: '',
    },
  },
  model: {
    prop: 'value',
    event: 'change',
  },
  data() {
    return {
      options: {},
    }
  },
  computed: {},
  watch: {},
  created() {
    this.getData()
  },
  mounted() {},
  methods: {
    getData() {
      getEnum('mainBusiness', { order_num: 'desc' }).then(res => {
        this.options = res.enum || {}
      })
    },
    hangleChange(val) {
      this.$emit('select', this.options[val])
    },
  },
}
</script>

<style lang="scss" scoped></style>
